import 'package:flutter/material.dart';
import '../shower.dart';

class TwoScreen extends StatefulWidget {
  final String materialPath;
  final List<dynamic> blocks;
  TwoScreen({Key key, this.materialPath, this.blocks});
  @override
  _TwoScreenState createState() => new _TwoScreenState();
}

class _TwoScreenState extends State<TwoScreen> {
  // String _dirPath;
  // String _screenNum;
  @override
  Widget build(BuildContext context) {
    return Flex(
      direction: Axis.vertical,
      children: <Widget>[
        Expanded(
          flex: 1,
          child: Flex(
            direction: Axis.horizontal,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Expanded(
                flex: 1,
                child: Shower(dirPath: '${widget.materialPath}/0', showList: widget.blocks[0]['files'],),
              )
            ]
          ),
        ),
        Expanded(
          flex: 1,
          child: Flex(
            direction: Axis.horizontal,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Expanded(
                flex: 1,
                child: Shower(dirPath: '${widget.materialPath}/1', showList: widget.blocks[1]['files'],),
              )
            ]
          ),
        ),
      ],
    );
  }
}